package com.goldsign.pay.provider.user.service;

import com.goldsign.pay.provider.user.to.AccountRegisterReqDTO;
import com.goldsign.pay.provider.user.to.UserLoginReqDTO;
import com.goldsign.pay.provider.user.to.UserServiceResponseDTO;
import com.goldsign.pay.provider.user.vo.AccountRegOrderDO;
import com.goldsign.pay.common.exception.GcServiceException;

public interface UserService {
	
	/**
	 * 记录注册申请订单
	 * @param req
	 * @param orderNo
	 * @throws GcServiceException
	 */
	void insertAccountRegOrder(AccountRegisterReqDTO req, String orderNo) throws GcServiceException;

	/**
	 * 校验手机号码是否已注册
	 * @param req
	 * @return
	 * @throws GcServiceException
	 */
	boolean checkMobIsRegistered(AccountRegisterReqDTO req) throws GcServiceException;

	/**
	 * 记录短信订单
	 * @param req
	 */
	void insertSmsOrder(AccountRegisterReqDTO req,String busiWaterNo, String smsOrderNo) throws GcServiceException;

	/**
	 * 调用短信服务，发送短信验证码
	 * @throws GcServiceException
	 */
	void sendRegisterMessage() throws GcServiceException;

	/**
	 * 根据订单号获取账户注册信息
	 * @param orderNo
	 * @return
	 * @throws GcServiceException
	 */
	AccountRegOrderDO getAccountRegOrderByOrderNo(String orderNo) throws GcServiceException;

	/**
	 * 校验短信验证码是否正确
	 * @param busiWaterNo 业务(注册、登录等)订单号
	 * @param verifyCode 短信验证码
	 * @return 校验结果：SUCCESS or failure reason
	 * @throws GcServiceException
	 */
	UserServiceResponseDTO validateSmsVerifyCode(String busiWaterNo, String terminalNo,
												 String verifyCode, String smsType) throws GcServiceException;

	void updateAccountRegOrder(AccountRegisterReqDTO req) throws GcServiceException;

	/**
	 * 创建用户账户
	 * @param order
	 * @return 用户编号
	 * @throws GcServiceException
	 */
	String createUserAccount(AccountRegOrderDO order) throws GcServiceException;

	/**
	 * 记录用户的登录日志信息
	 * @param req
	 * @return
	 * @throws GcServiceException
	 */
	String insertLoginLog(UserLoginReqDTO req) throws GcServiceException;

	/**
	 * 更新用户登录结果
	 * @param id
	 * @param respCode
	 * @throws GcServiceException
	 */
	void updateLoginLog(String id, String respCode) throws GcServiceException;

	String checkLoginPasswd(UserLoginReqDTO req, String id) throws GcServiceException;
}


